{extend name="public:layout" /}
{block name="title"}添加角色{/block}
{block name="head"}{/block}
{block name="body"}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="ibox">
        <div class="ibox-title">
            <ol class="breadcrumb">
                <li><i class="fa fa-hand-o-right"></i> <a href="{:url('index',['utype'=>$Request.param.utype])}">
                    角色列表</a></li>
                <li class="active">添加角色</li>
            </ol>
        </div>
        <div class="ibox-content">
            <form method="post" class="form-horizontal" id="form">
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">权限编码</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" name="group_id" value="" datatype="*"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">角色名称</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" name="title" value="" datatype="*"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">角色描述</label>
                    <div class="col-sm-8">
                        <textarea name="description" class="form-control"></textarea>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">权限规则</label>
                    <div class="col-sm-10">
                        <select name="rules[]" data-placeholder="请选择权限规则" class="chosen-select form-control" multiple>
                            <option value="all">全部规则</option>
                            {volist name="authRule" id="vo"}
                            <option value="{$vo.rule_id}">{$vo._name}</option>
                            {/volist}
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">文档投稿栏目</label>
                    <div class="col-sm-10">
                        <select name="cms_cids[]" data-placeholder="请选择文档投稿栏目" class="chosen-select form-control" multiple>
                            <option value="all">全部栏目</option>
                            {volist name="cmsCategory" id="vo"}
                            <option value="{$vo.cid}">{$vo._name}</option>
                            {/volist}
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">商品投稿栏目</label>
                    <div class="col-sm-10">
                        <select name="goods_cids[]" data-placeholder="请选择商品投稿栏目" class="chosen-select form-control" multiple>
                            <option value="all">全部栏目</option>
                            {volist name="goodsCategory" id="vo"}
                            <option value="{$vo.cid}">{$vo._name}</option>
                            {/volist}
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">状态</label>
                    <div class="col-sm-4">
                        <label class="radio-inline i-checks">
                            <input type="radio" name="status" value="1" checked/> 启用
                        </label>
                        <label class="radio-inline i-checks">
                            <input type="radio" name="status" value="0"/> 禁用
                        </label>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">排序</label>
                    <div class="col-sm-2">
                        <input type="text" class="form-control" name="group_sort" value="0"/>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-4 col-sm-offset-2">
                        <button class="btn btn-primary" id="btnSub" type="button">
                            保存内容
                        </button>
                        <a href="{:url('index',['utype'=>$Request.param.utype])}" class="btn btn-white">取消</a>
                        <span id="validError"></span>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
    $(function () {
        iCheck();
        ajaxSubForm('#btnSub');
        In('chosen',function () {
            $('.chosen-select').chosen();
        })
    });
</script>
{/block}